import Vue from 'vue';
import App from './App';
import VueRouter from 'vue-router';
import VueResource from 'vue-resource';
// 引入子组件到路由
import goods from 'components/goods/goods';
import seller from 'components/seller/seller';
import ratings from 'components/ratings/ratings';

Vue.config.productionTip = false;

// 开启debug模式
Vue.config.debug = true;

Vue.use(VueRouter);
Vue.use(VueResource);

// 创建一个路由实例，并且配置路由规则
let router = new VueRouter({
	linkActiveClass: 'active',
	routes: [
		{
			path: '/goods',
			component: goods
		},
		{
			path: '/ratings',
			component: ratings
		},
		{
			path: '/seller',
			component: seller
		}
	]
});

/* eslint-disable no-new */
new Vue({
	router,
	render: h => h(App)
}).$mount('#app');

router.push('/goods');
